package com.ljkj.zjf.common;

public class RegexUtil {
	
    public static boolean isPositiveInt(String str){
    	return str.matches("[0-9]+");
    }
    
    public static boolean isPositiveIntOrDecimal(String str){
    	return str.matches("\\d+(\\.\\d+)?");
    }
    
   
    public static boolean verifyDate(String str){
    	String regexStr = "(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})"
            + "(((0[13578]|1[02])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})"
            + "(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))0229)";
    	return str.matches(regexStr);
    }
    
    public static boolean verifyMonth(String str){
    	String regexStr = "^[1-9]{1}[0-9]{3}((0[1-9]{1})|(1[0-2]{1}))$";
    	return str.matches(regexStr);
    }

}